<?php

// Class not required anmore

class wgEssentialObjectRoute extends sfDoctrineRoute
{

  public function matchesUrl( $url, $context = array(), $requirements = array(), $options = array() )
  {
    if ( false === $parameters = parent::matchesUrl( $url, $context, $requirements, $options ) )
      return false;
    return array_merge( array( 'sf_application' => sfConfig::get( 'sf_app' ) ), $parameters );
  }

  protected function getRealVariables()
  {
    return array_merge( array( 'sf_application' ), parent::getRealVariables() );
  }

  protected function doConvertObjectToArray( $object )
  {
    $parameters = parent::doConvertObjectToArray( $object );
    unset( $parameters['sf_application'] );
    return $parameters;
  }

}